'''
Created on 2011-07-07

@author: Gangli
'''

import sys;
import re;

regex = re.compile(r"^(\S\S\S\s\d\d\s\d\d:\d\d:\d\d)\s+\d+\s+(\d+)\s+(\d+)\.+@", re.I);

def ParseLine(sLine):
	m = regex.match(sLine);
	if m == None:
		return 0;
	else
		return int(m.group(2));

def ParseFile(sFilename, nCode):
	
	
	fin = open(sFilename, "r");
	
	for sLine in fin:
		nActualCode = ParseLine(sLine);
		if nActualCode == nCode:
			print sLine;
		elif nActualCode == 0:
			print sLine;
	
	fin.close();
	

if __name__ == '__main__':
    if len(sys.argv) < 2:
        print "Log file must be provided.";
        sys.exit(1);
    
    sLogfile = sys.argv[1];
    oLogfile = open(sLogfile, "r");
       
    for sLine in oLogfile:
        if IsWhatIWant(sLine):
            if sLine[len(sLine) - 1] == "\n":
                print sLine[:len(sLine) - 1];
            else:
                print sLine;